home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PCGUIA 111
/
PC Guia 111.iso
/
Software
/
Utils
/
NetObjects Fusion 7.0
/
NOF7Trial.exe
/
data1.cab
/
Fsi_-_English
/
Update
/
Update.js
< prev
Wrap
Text File
|
2002-06-12
|
2KB
|
46 lines
function update()
{
var app = new ActiveXObject('FSI.FSIApplication');
var app2 = new ActiveXObject('FSI.FSIApplication2');
var versionString = app.GetRegistryString(true, 'Version');
versionString = versionString.split('.');
var version = versionString[0];
var versionInfo = app.GetRegistryString(true, 'VersionInfo');
var thePath = app.AppDirectory + 'FSIUpdater\\Updater.zip'
if (app.CurrentUpdater < app.LatestUpdater)
{
app.OpenProgressDialog('Updating', 'Getting updater file information...', 0, 0, true);
result = updateUpdater(app, thePath, version, versionInfo);
app.CloseProgressDialog(0);
if (!result)
{
app.DeleteTempDir();
window.showModalDialog("../InitFusion/UpdateIncomplete.html", 0,
"status:no;help:no;border:thin;dialogWidth:205px;dialogHeight:110px;center:yes;scroll:no;");
return false;
}
}
app2.ExtractZipFile(thePath, app.GetTempDir());
app.RunFSI(app.GetTempDir() + '\\Update.html', 'run()');
var result = app.GetInstVar('update');
return result;
}
function updateUpdater(app, localPath, version, versionInfo)
{
var request = 'Application=Fusion&Version=' + version + '&VersionInfo=' + versionInfo + '&Type=UpdaterUpdate';
var response = app.HttpRequest('http://www.netobjects.com/update/UpdateFile.cgi', '', request, false, false, true);
if (!response.length)
return false;
app.SetProgressMessage('Downloading updater file...');
if (!app.HttpDownload(response, '', '', true, localPath, true))
return false;
app.CurrentUpdater = app.LatestUpdater;
return true;
}